package com.xxx.user.api;


import com.xxx.user.dto.MenuCreateReqDTO;
import com.xxx.user.dto.MenuGetAllResDTO;
import com.xxx.user.dto.MenuUpdateReqDTO;
import com.xxx.user.service.MenuService;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Slf4j
@RestController
@AllArgsConstructor
public class MenuApiImpl implements MenuApi {

    private final MenuService menuService;

    @Override
    public String create(@RequestBody MenuCreateReqDTO param) {
        return menuService.create(param);
    }

    @Override
    public String update(@RequestBody MenuUpdateReqDTO param) {
        return menuService.update(param);
    }

    @Override
    public String delete(@RequestBody List<Long> ids) {
        return menuService.delete(ids);
    }

    @Override
    public List<MenuGetAllResDTO> getAll() {
        return menuService.getAll();
    }

    @Override
    public Boolean refreshMenuCache(@RequestBody List<Long> menuIds) {
        return menuService.refreshMenuCache(menuIds);
    }

}
